import * as actionTypes from '../actions/ActionTypes';

import { handleActions } from 'redux-actions';

//全查
const defData = {
    postionSendList: []
}

export const selMeAllReducer = handleActions({
    [actionTypes.SEL_MEALL]: {
        next(state, action) {
            if (action.payload.page != 1) {//不是第一页时追加postionSendList
                action.payload.postionSendList = state.data.postionSendList.concat(action.payload.postionSendList);
            }
            return { ret: true, isloading: false, data: action.payload };
        },
        throw(state, action) {
            return { ret: false, isloading: false, data: defData };
        }
    }
}, { ret: true, isloading: true, data: defData });